#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project ：test_git 
@File    ：tw_decorator.py
@IDE     ：PyCharm 
@Author  ：宋怡文
@Date    ：2021/11/23 19:55 
'''


class DateFormat:

    def __init__(self, year, month, day):
        self.year = year
        self.month = month
        self.day = day

    def out_data(self):
        return f"输入的时间为{self.year}年{self.month}月{self.day}日"

    @classmethod
    def josn_format(cls,json_date):
        year,month,day = json_date['year'],json_date['month'],json_date['day']
        return cls(year,month,day)


year,month,day = 2021,11,23
demo = DateFormat(year,month,day)

print(demo.out_data())